Whitespace cleanup.
xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~
xen/drivers/block/xen_block.c~
xen/drivers/block/xen_physdisk.c~
+tools/internal/xi_phys_grant.c~
+tools/internal/xi_phys_probe.c~
+tools/internal/xi_phys_revoke.c~
int main(int argc, char *argv[])
{
- xp_disk_t buf;
- int fd;
- char *strbuf;
-
- if (argc != 7) {
- fprintf(stderr, "Usage: xi_physdev_grant <r/rw> <domain> <device> <start sector> <n_sectors> <partition>\n");
- return 1;
- }
-
- buf.mode = 0;
- if (argv[1][0] == 'r')
- buf.mode |= 1;
- else if (argv[1][0] == 'w')
- buf.mode |= 2;
- if (argv[1][1] == 'r')
- buf.mode |= 1;
- else if (argv[1][1] == 'w')
- buf.mode |= 2;
-
- buf.device = atol(argv[3]);
- buf.start_sect = atol(argv[4]);
- buf.n_sectors = atol(argv[5]);
- buf.partition = atol(argv[6]);
-
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]);
- fd = open(strbuf, O_WRONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
-
- write(fd, &buf, sizeof(buf));
- close(fd);
-
- return 0;
+ xp_disk_t buf;
+ int fd;
+ char *strbuf;
+
+ if (argc != 7) {
+ fprintf(stderr,
+ "Usage: xi_physdev_grant <r/rw> <domain> <device> <start sector> <n_sectors> <partition>\n");
+ return 1;
+ }
+
+ buf.mode = 0;
+ if (argv[1][0] == 'r')
+ buf.mode |= 1;
+ else if (argv[1][0] == 'w')
+ buf.mode |= 2;
+ if (argv[1][1] == 'r')
+ buf.mode |= 1;
+ else if (argv[1][1] == 'w')
+ buf.mode |= 2;
+
+ buf.device = atol(argv[3]);
+ buf.start_sect = atol(argv[4]);
+ buf.n_sectors = atol(argv[5]);
+ buf.partition = atol(argv[6]);
+
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]);
+ fd = open(strbuf, O_WRONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
+
+ write(fd, &buf, sizeof(buf));
+ close(fd);
+
+ return 0;
}
int main(int argc, char *argv[])
{
- physdisk_probebuf_t buf;
- int fd;
- int x;
- char *strbuf;
+ physdisk_probebuf_t buf;
+ int fd;
+ int x;
+ char *strbuf;
- if (argc != 2) {
- fprintf(stderr, "Usage: xi_phys_probe <domain_nr>\n");
- return 1;
- }
+ if (argc != 2) {
+ fprintf(stderr, "Usage: xi_phys_probe <domain_nr>\n");
+ return 1;
+ }
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
- fd = open(strbuf, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
+ fd = open(strbuf, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
- memset(&buf, 0, sizeof(buf));
- buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
- do {
+ memset(&buf, 0, sizeof(buf));
buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
- read(fd, &buf, sizeof(buf));
- if (!buf.n_aces)
- break;
+ do {
+ buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
+ read(fd, &buf, sizeof(buf));
+ if (!buf.n_aces)
+ break;
- for (x = 0; x < buf.n_aces; x++) {
- char read = ( buf.entries[x].mode & 1 ? 'r' : ' ' );
- char write = ( buf.entries[x].mode & 2 ? 'w' : ' ' );
- printf("%x %x %lx %lx %c%c\n", buf.entries[x].device,
- buf.entries[x].partition,
- buf.entries[x].start_sect,
- buf.entries[x].n_sectors,
- read,
- write);
- }
- buf.start_ind += buf.n_aces;
- } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST);
- return 0;
+ for (x = 0; x < buf.n_aces; x++) {
+ char read = (buf.entries[x].mode & 1 ? 'r' : ' ');
+ char write = (buf.entries[x].mode & 2 ? 'w' : ' ');
+ printf("%x %x %lx %lx %c%c\n", buf.entries[x].device,
+ buf.entries[x].partition,
+ buf.entries[x].start_sect,
+ buf.entries[x].n_sectors, read, write);
+ }
+ buf.start_ind += buf.n_aces;
+ } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST);
+ return 0;
}
int main(int argc, char *argv[])
{
- xp_disk_t buf;
- int fd;
- char *strbuf;
+ xp_disk_t buf;
+ int fd;
+ char *strbuf;
- if (argc != 5) {
- fprintf(stderr, "Usage: xi_physdev_revoke <domain> <device> <start sector> <n_sectors>\n");
- return 1;
- }
+ if (argc != 5) {
+ fprintf(stderr,
+ "Usage: xi_physdev_revoke <domain> <device> <start sector> <n_sectors>\n");
+ return 1;
+ }
- buf.device = atol(argv[2]);
- buf.mode = 0;
- buf.start_sect = atol(argv[3]);
- buf.n_sectors = atol(argv[4]);
+ buf.device = atol(argv[2]);
+ buf.mode = 0;
+ buf.start_sect = atol(argv[3]);
+ buf.n_sectors = atol(argv[4]);
- asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
- fd = open(strbuf, O_WRONLY);
- if (fd < 0) {
- fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
- return 1;
- }
- free(strbuf);
+ asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]);
+ fd = open(strbuf, O_WRONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno));
+ return 1;
+ }
+ free(strbuf);
- write(fd, &buf, sizeof(buf));
- close(fd);
+ write(fd, &buf, sizeof(buf));
+ close(fd);
- return 0;
+ return 0;
}